package com.syedu.day03.homework;

import java.util.Scanner;

/**
 * description：
 * 设计一个程序,输出如下: 输入数字,计算这个数字的阶乘
 *
 * @author Administrator
 * @date 2022/3/8 13:35
 */
public class Factorial {
    public static void main(String[] args) {
        long result = 1L;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请您输入一个数字:");
        int num = scanner.nextInt();
        for (int i = num; i > 0; i--) {
            result *= i;
        }
        System.out.println(num + "的阶乘为: " + result);
    }
}